<?php

class Session extends Base
{
    private $data=array();

    public function __construct()
    {
        $this->data=$_SESSION;
    }

    public function __set($name,$value)
    {
        $_SESSION[$name]=$value;
        $this->data[$name]=$value;;
    }

    public function __get($name)
    {
        if(isset($this->data[$name])) return $this->data[$name];
        else return false;
    }

    public function __unset($name)
    {
        if(isset($this->data[$name])){
            unset($_SESSION[$name]);
            unset($this->data[$name]);
        }
    }
}